﻿using Grasshopper.GUI.RemotePanel;
using Grasshopper.Kernel;
using System;
using System.Collections.Generic;

namespace D003_Param
{
    public class Param_Human : GH_PersistentParam<GH_Human>, IRcpAwareObject
    {
        private class Param_HumanPublishProxy : RcpDocumentObjectItem<Param_Human>
        {
            public Param_HumanPublishProxy(Param_Human owner) : base(owner)
            {
            }
        }

        protected override System.Drawing.Bitmap Icon => Properties.Resources.human;
        public override Guid ComponentGuid => new Guid("205DA7CF-B1E8-4609-B2F7-95ACCB35F19E");


        public Param_Human()
          : base("Human", "h",
              "参数类型——人类",
              "PluginTest", "参数")
        {
        }



        protected override GH_GetterResult Prompt_Singular(ref GH_Human value)
        {
            value = new GH_Human();
            value.Value.Name = "Jim";
            value.Value.Age = 25;
            value.Value.Id = 1;
            return GH_GetterResult.success;
        }

        protected override GH_GetterResult Prompt_Plural(ref List<GH_Human> values)
        {
            return GH_GetterResult.cancel;
        }

        public IRcpItem PublishRcpItem()
        {
            return new Param_HumanPublishProxy(this);
        }
    }
}